# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # 
# Description:                                                          #
# This is a Cython binding for the Boost Interval Library.              #
#                                                                       #
# Author:                                                               #
#     Harald Schilly - harald.schilly@gmail.com                         #
#     2008, Vienna, Austria                                             #
#                                                                       #
# Copyright: ALL RIGHTS RESERVED                                        #
# License:   GPL v2+ (http://www.gnu.org/licenses/gpl-2.0.html)         #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #  


# external structures from the pyBoostInterval.hpp helper file
cdef extern from "pyBoostInterval.hpp":
    ctypedef struct IVD "IVD":
        double    lower       ()
        double    upper       ()
        void      assign      (double l, double u)

    IVD       IVD_copy       "IVD"       (IVD *i)
    IVD      *new_IVD_1      "new IVD"   (double x1)
    IVD      *new_IVD_2      "new IVD"   (double x1, double x2)
    void      del_IVD        "delete"    (IVD *i)

    IVD       sin_c                      (IVD *i)
    IVD       cos_c                      (IVD *i)
    IVD       tan_c                      (IVD *i)
    IVD       sqrt_c                     (IVD *i)
    IVD       intersect_c                (IVD *i, IVD *i)

    bint      singleton                  (IVD *i)
    bint      in_c                       (double d, IVD *i)
    bint      subset_c                   (IVD *self, IVD *other)
    bint      overlap_c                  (IVD *a, IVD *b)

    IVD       add_op_c       "add_op"    (IVD *l, IVD *r)
    #IVD       add_op_c       "operator+" (IVD l, IVD r)
    IVD       sub_op_c       "sub_op"    (IVD *l, IVD *r)
    IVD       mul_op_c       "mul_op"    (IVD *l, IVD *r)
    IVD       div_op_c       "div_op"    (IVD *l, IVD *r)
    IVD       pow_op_c       "pow_op"    (IVD *b, int e)

    IVD       square_c       "square"    (IVD *i)

    IVD       widen_c        "widen_c"   (IVD*i, double w)

    double    median_c       "median"    (IVD *i)
    double    width_c        "width"     (IVD *i)
    

    ctypedef struct i_pair "i_pair":
        IVD  first
        IVD  second

cdef extern from "pyBoostInterval.hpp":
    i_pair  bisect_c                   (IVD *i)

# end of structure definitions


#cdef class Interval:
#    cdef _new(self, double x1=*, double x2=*)

